import request from '@/axios'

const BASE_PATH = "/role"

export const saveApi = (data: any = {}): Promise<IResponse> => {
  return request.post({
    url: BASE_PATH + '/save',
    data
  })
}

export const deleteApi = (id: string): Promise<IResponse> => {
  return request.delete({
    url: BASE_PATH + "/delete",
    params: {
      id
    }
  })
}

export const getPageApi = (params: any = {}): Promise<IResponse> => {
  return request.get({ url: BASE_PATH + '/page', params })
}

export const getDetilApi = (params: any = {}): Promise<IResponse> => {
  return request.get({ url: BASE_PATH + '/getDetail', params })
}

export const getlistApi = (params: any = {}): Promise<IResponse> => {
  return request.get({ url: BASE_PATH + '/list', params })
}